package com.zjitc.controller;

import com.zjitc.model.Product;
import com.zjitc.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/6/7 14:48
 * @description:
 */
@Controller
public class TestControl {

    @Autowired
    private ProductService service;

    @RequestMapping(value = "/getUser1")
    @ResponseBody
    public Product getUser() {
        Product product = service.findByPid("1");
        return product;
    }

    @RequestMapping(value = "/getString1")
    @ResponseBody
    public String getString() {
        return "1";
    }
}
